package com.xsb.butterknife.library;

import android.app.Activity;

public class ButterKnife {
    public static void bind(Activity activity){
        String className = activity.getClass().getName() + "$ViewBinder";
        try {
            Class<?> viewBindClass = Class.forName(className);
            ViewBinder  viewBinder = (ViewBinder) viewBindClass.newInstance();
            viewBinder.bind(activity);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void unBind(Activity activity){
        String className = activity.getClass().getName() + "$ViewBinder";
        try {
            Class<?> viewBindClass = Class.forName(className);
            ViewBinder  viewBinder = (ViewBinder) viewBindClass.newInstance();
            viewBinder.unBind();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
